home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Reread current directory with TwinExpress from DOpus.
- *
- * (c) 1994 by K.P. van Beem (2:280/464.2, patrick.van.beem@aobh.xs4all.nl)
- *
- * Based on the DOpusLhaARexx package by Geoff Seeley (but you can better
- * use GuiArc in stead of DOpus and a script, to deal with archives)
- *
- * Mods By Ray Abram
- * - Caching
- * - checks if the caching file is there, and if it is, then delete it...
- *
- * - If called on a DOpus Dir, then will tell Dopus to do a ReScan of the Dir
- */
-
- trace ?R
-
- DOpusPort = 'DOPUS.1'
-
- if ~show(l,"rexxsupport.library") then
- call addlib("rexxsupport.library",0,-30,0)
- if showlist('Ports', DOpusPort) = 0 then do
- say 'Directory Opus Arexx port not found. Aborting.'
- exit
- end
-
- address 'DOPUS.1'
- options results
-
- /* Check for a DOpus directory */
- 'Status 6 -1'
- GetEntry Result
- FilePath = Result
- if left(FilePath,1) ~= '*' then do
- Rescan
- Busy off
- exit
- end
-
-
- FilePath = SubStr(FilePath,2)
-
- /* convert path to filename */
- Cache = 'TwinDirs:' || ConvertFilename(FilePath)
-
- /* check for the dir already stored in ram: and delete it if found*/
- if exists(Cache) then
- address COMMAND "Delete >NIL:" Quote(Cache)
-
- address AREXX "Rexx:DOpus/ReadDir.rexx" FilePath
-
- exit
-
- /*--------------------------------------------------------------------------*/
-
- /* convert a file name from df0:ray/was/here -> df0=ray\was\here
- then to -> d0=ry\ws\he (cache filename)*/
- ConvertFilename: procedure
-
- parse arg Dev ':' Path
-
- if left(dev,1) = '~' then
- dev = '`' || right(dev,length(dev)-1)
-
- t2 = ''
- Convert = ''
- do until (t2 = '')
- parse var Path t1 '/' t2
- Path = t2
- if t2 ~= '' then
- end = '\'
- else
- end = ''
- Convert = Convert || left(t1,1) || right(t1,1) || end
- end
-
- if left(Convert,1) = ' ' then
- Convert = ''
-
- out = Dev || '=' || Convert
-
- return out
-
- /*--------------------------------------------------------------------------*/
-
- /* add quotes to string */
- Quote: procedure
- parse arg string
- return '"'||string||'"'
-
- /*--------------------------------------------------------------------------*/
-